import * as types from './mutation-types'

/**
 * 用户信息
 */
export function setUserInfo({commit}, key) {
	return new Promise((resolve, reject) => {
		uni.setStorage({
			key: 'lab_userInfo',
			data: key,
			success: () => {
				commit(types.SET_USER_INFO, key)
				resolve(key)
			}
		});
	}).catch(err => {
		reject(err)
	})
}
export function logOut({
	commit
}, key) {
	commit(types.LOG_OUT, key)
}
/**
 * 	助记词
 */
export function setMnemonic({commit}, key) {
	commit(types.SET_MNEMONIC, key)
}

/**
 * 	钱包
 */
export function setWalletInfo({commit}, key) {
	commit(types.SET_WALLET_INFO, key)
}
/**
 * 	版本检查
 */
export function setUpdate({commit}, key) {
	commit(types.SET_UPDATE, key)
}
